1st order integrating factors

Table of Contents

intro

Pretty straightforward for this one.
Adapted from notes for Oregon State Math 256.

My other notes are more fun.

first order linear equations (integrating factors)

Consider a first-order linear differential equation:

\[a_1(x) \frac{dy}{dx} + a_0(x) y = g(x).
\]

By dividing through by \(a_1(x)\), we can rewrite it in the standard form:

\[\frac{dy}{dx} + p(x) y = f(x).
\]

Looking at the LHS, it resembles the product rule applied to \(y(x)\) and some function \(\mu(x)\):

\[\frac{d}{dx}[\mu(x) y] = \mu(x) \frac{dy}{dx} + \mu'(x) y.
\]

Multiplying both sides of the equation by \(\mu(x)\) gives:

\[\mu(x) \frac{dy}{dx} + \mu(x) p(x) y = \mu(x) f(x).
\]

To match the LHS to the form of the product rule for \(\mu(x) y\), we need a function \(\mu(x)\) that satisfies:

\[\mu'(x) = \mu(x) p(x).
\]

Integrating both sides of this equation yields:

\[\ln |\mu(x)| = \int p(x) dx.
\]

Therefore, the possibilities for \(\mu(x)\) are:

\[\mu(x) = \pm e^{\int p(x) dx}.
\]

These functions are known as integrating factors (IF).
In the case of first-order linear differential equations, we only need one IF.
To simplify the process, we choose \(\mu(x) = e^{\int p(x) dx}\) and set the constant of integration to 0.
With this choice, the equation \(\mu(x) \frac{dy}{dx} + \mu(x) p(x) y = \mu(x) f(x)\) becomes \(\left[y e^{\int p(x) dx}\right]' = f(x) e^{\int p(x) dx}\)
This allows us to integrate both sides and solve for \(y\)

Examples:

  1. \(y'+\frac{3}{x}y=\frac{4}{x^5}\)
    We can use an IF of \(\mu(x)=e^{\int \frac{3}{x} dx}=e^{3\ln|x|}=\pm x^3\)
    By multiplying both sides of \(y'+2xy=x^3\) by \(\mu=x^3\), we get \(x^3y'+3x^2y=\frac{4}{x^2}\)
    This equation can be rewritten as \(\left(x^3y\right)'=\frac{4}{x^2}\)
    By integrating both sides, \(x^3y=-\frac{4}{x}+C\)
    So \(y=\frac{C}{x^3}-\frac{4}{x^4}\) is the general solution.
  2. \(xy'-3y=x^4e^x\)
    First, we rewrite this in the standard form to get \(y'-\frac{3}{x}y=x^3e^x\)
    So an IF is \(\mu(x)=e^{\int-\frac{3}{x} dx}=e^{-3\ln|x|}=\pm x^{-3}\)
    Notice the integrand's sign here.
    By multiplying both sides of \(y'-\frac{3}{x}y=x^3e^x\) by \(\mu=x^{-3}\), we get \(x^{-3}y'-3x^{-4}y=e^x\)
    This equation can be rewritten as \(\left(x^{-3}y\right)'=e^x\)
    By integrating both sides, \(x^{-3}y=e^x+C\)
    So \(y=x^3e^x+Cx^3\) is the general solution.
  3. \(y'+2xy=x^3\)
    An IF is \(\mu=e^{\int 2x dx}=e^{x^2}\)
    By multiplying both sides of \(y'+2xy=x^3\) by \(\mu\) we get

    \[e^{x^2} y'+2x e^{x^2} y=x^3 e^{x^2}\]

    This equation can be rewritten as

    \[\left(e^{x^2} y\right)^{\prime}=x^3 e^{x^2}\]

    By integration by parts,

    \[e^{x^2} y=\frac{1}{2} e^{x^2}\left(x^2-1\right)+C\]

    Hence \(y=\frac{1}{2}\left(x^2-1\right)+C e^{-x^2}\) is the general solution.

  4. \(y'+\cos (t) y=\sin (t), y(0)=2\)
    First we rewrite this in the standard form to get \(y'+y\tan(t)=\sec(t)\)
    So an IF is \(\mu=e^{\int\tan(t) dt}=e^{\ln|\sec(t)|}= \pm \sec(t)\)
    By

  5. multiplying both sides of \(y'+y\tan(t)=\sec(t)\) by \(\mu=\sec(t)\) we get

    \[\sec(t) y'+\sec(t)\tan(t) y=\sec^2(t) .
    \]

    This equation can be rewritten as

    \[(\sec(t) y)^{\prime}=\sec^2(t) .
    \]

    By integrating both sides, \(\sec(t) y=\tan(t)+C .
    \) Then \(y=\sin(t)+C\cos(t)\) is the general solution.
    Imposing the initial condition of \(y(0)=2\) yields \(C=2\) and a solution of \(y=\sin(t)+2\cos(t) .
    \)

  6. \(y'-2xy=1, y(1)=e\) An IF is \(\mu=e^{\int-2x dx}=e^{-x^2}\)
    By multiplying both sides by \(\mu\) we get

    \[e^{-x^2} y'-2xe^{-x^2} y=e^{-x^2}\]

    This equation can be rewritten as

    \[\left(e^{-x^2} y\right)^{\prime}=e^{-x^2}\]

    But the integral of \(e^{-x^2}\) does not have an expression in terms of elementary functions.
    Looking at the initial condition of \(y(1)=2\) we will use the integral function \(F(x)=\int_1^x e^{-t^2} dt\) as an antiderivative of \(f(x)=e^{-x^2}\)
    So we may write that \(e^{-x^2} y=\int_1^x e^{-t^2} dt+C\)
    Then the general solution is \(y=e^{x^2} \int_1^x e^{-t^2} dt+C e^{x^2}\) Imposing the initial condition of \(y(1)=e\) yields \(C=1\)
    So the solution is \(y=e^{x^2} \int_1^x e^{-t^2} dt+e^{x^2}\) Try doing the homework for this section using the method of IF instead of the method of variation of parameters shown in the text.

transformations

Sometimes you can make a substitution to transform a differential equation into something more familiar.
Examples:
\[y'=\frac{x+y-1}{x+y+1}\]
\[u=x+y\] Then

\[y=u-x \Rightarrow y'=u'-1 \Rightarrow u'-1=\frac{u-1}{u+1} \Rightarrow u'=\frac{u-1}{u+1}+1=\frac{2u}{u+1}\]

That’s separable.

\[\begin{aligned} &\Rightarrow \frac{u+1}{2u} du=dx \Rightarrow \int \frac{1}{2}+\frac{1}{2u} du=\int dx \Rightarrow \frac{1}{2}u+\frac{1}{2}\ln|u|=x+c \\ &\Rightarrow \frac{1}{2}(x+y)+\frac{1}{2}\ln|x+y|=x+c \Rightarrow \frac{1}{2}y+\frac{1}{2}\ln|x+y|=x+C \Rightarrow y+\ln|x+y|=2x+2C \end{aligned}\]

Examples:
\(y+x\tan\left(\frac{y}{x}\right)-x\frac{dy}{dx}=0\)
Divide by \(x\) to get \(\frac{y}{x}\) showing up more than once:

\[\frac{y}{x}+\tan\left(\frac{y}{x}\right)-\frac{dy}{dx}=0\]

Then try \[u=\frac{y}{x}\]

\[\Rightarrow y=ux \Rightarrow y'=u+xu' \Rightarrow u+\tan(u)-\left(u+xu'\right)=0 \Rightarrow \tan(u)-xu'=0\]

Separable.

\[\Rightarrow xu'=\tan(u) \Rightarrow \frac{\cos(u)}{\sin(u)}du=\frac{dx}{x} \Rightarrow \int\frac{\cos(u)}{\sin(u)}du=\int\frac{dx}{x}\]

Using \(w=\sin(u) \Rightarrow dw=\cos(u)du\)

\(\Rightarrow \int\frac{dw}{w}=\ln|x|+c \Rightarrow \ln|w|=\ln|x|+c \Rightarrow \ln\left|\sin\left(\frac{y}{x}\right)\right|=\ln|x|+c \Rightarrow \sin\left(\frac{y}{x}\right)=Cx\)

Definition: If a first-order differential equation can be written in the form

\[y' = g\left(\frac{y}{x}\right)\]

then the differential equation is homogeneous.
[This is not the same as before, \(y' + x^2 y = 0\)

This is a special case of the more general definition: \(f\) is homogeneous of degree \(n\) if \(f(kx, ky) = k^n f(x, y)\) for any constant \(k\)

The substitution \(u = \frac{y}{x}\) will always transform a homogeneous differential equation into a separable one:

\[ \begin{aligned} &y = ux, \quad y' = g\left(\frac{y}{x}\right) \\ &y' = u + xu' \Rightarrow u + xu' = g(u) \Rightarrow \frac{du}{g(u)-u} = \frac{dx}{x}.
\end{aligned} \]

Example: \(y' = \frac{x+y}{x} = 1 + \frac{y}{x} = g\left(\frac{y}{x}\right)\) is homogeneous.

Example: \(y' = \frac{x^2+y}{x} = x + \frac{y}{x} \neq g\left(\frac{y}{x}\right)\) is not homogeneous.

Example: \(xy' = xe^{-y/x} + y, \quad x > 0\)

\(y' = e^{-y/x} + \frac{y}{x}\) is homogeneous.

\[ \begin{aligned} &u = \frac{y}{x} \Rightarrow u + xu' = e^{-u} + u \Rightarrow xu' = e^{-u} \Rightarrow e^u du = \frac{dx}{x} \\ &\Rightarrow e^u = \ln(x) + \overbrace{C}^{\ln(C)} = \ln(Cx) \quad (C > 0) \\ &\Rightarrow \frac{y}{x} = \ln(\ln(Cx)) \Rightarrow y = x\ln(\ ln(Cx)) \end{aligned} \]

A useful class of nonlinear differential equations are "Bernoulli differential equations."
These differential equations can always be made first-order linear by a substitution (so we can solve them) Definition: A differential equation of the form

\[\frac{dy}{dx}+p(x) y=f(x) y^r \quad(r \neq 0,1)\]

A Bernoulli differential equation can be transformed into a first-order linear differential equation using the substitution \(u=y^{1-r}\) or into a separable differential equation using the variation of parameters technique.

\[y'+p(x) y=f(x) y^r \quad(r \neq 0,1)\]

\[\begin{gathered} \xrightarrow[\text {multiply } y^{-r}]{} \quad y^{-r} y'+p(x) y^{1-r}=f(x) \\ u=y^{1-r} \Rightarrow u'= (1-r) y^{-r} y' \Rightarrow \frac{1}{1-r} u'=y^{-r} y' \\ \Rightarrow \underbrace{\frac{1}{1-r} u'+p(x) u=f(x)}_{\text {1st-order linear } } \quad \end{gathered}\]

Examples:
the Bernoulli differential equation \(y'+\frac{1}{x} y=3 y^3\) (set \(r=3\)). Note: \(y=0\) is a solution.
Let’s look for non-trivial solutions.
\[\begin{aligned} & \xrightarrow[\times y^{-3}]{} \quad y^{-3} y'+\frac{1}{x} y^{-2}=3. \\ & \xrightarrow[u\text{-sub} ]{} \quad u=y^{1-3}=y^{-2} \Rightarrow u'= -2 y^{-3} y' \Rightarrow-\frac{1}{2} u'=y^{-3} y' \\ & \xrightarrow[ \tiny{1^{\text{st}}\text{ order linear}} ]{} \quad -\frac{1}{2} u'+\frac{1}{x} u=3 \Rightarrow u'-\frac{2}{x} u=-6 \\ & \Rightarrow \quad \mu=e^{-2 \ln |x|}=x^{-2} \\ & \xrightarrow[\times \mu]{} \quad (x^{-2} u)' =-6 x^{-2} \Rightarrow \int (x^{-2} u)' dx = \int -6 x^{-2} dx \\ & \Rightarrow \quad x^{-2} u=6 x^{-1}+C \Rightarrow u=6 x+C x^2 \Rightarrow y^{-2}=6 x+C x^2 \\ & \Rightarrow \quad y= \pm \frac{1}{\sqrt{6 x+C x^2}}, \quad y=0 \end{aligned}\]